﻿@{
    Layout = null;
}
@model System.Data.DataTable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

    )
    <script type="text/javascript">

        var rootUrl = '@Url.Content("~/SupportPolicy/")';

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            var NSRMC = $("#hNSRMC").val();
            var FEnterprisePropNo = $("#hFEnterprisePropNo").val();
            var FProp = $("#hFProp").val();
        var  FTaxClassAllowanceNo=    $("#hFTaxClassAllowanceNo").val();
            e.customArgs["NSRMC"] = NSRMC;
            e.customArgs["FEnterprisePropNo"] = FEnterprisePropNo;
            e.customArgs["FProp"] = FProp
            e.customArgs["FTaxClassAllowanceNo"] = FTaxClassAllowanceNo;
        }

        function PolicyAdd() {
            location = rootUrl + 'policyEdit';
        }

        function PolicyEdit(id) {
            location = rootUrl + 'policyEdit/' + id;
        }

        function PolicyDel(id, index) {
            if (confirm("确定删除？")) {
                $.get(rootUrl + 'Delete/' + id, function (data) {
                    if (data) {
                        alert("删除成功！");
                        gvEditing.Refresh();
                        //$('#gvEditing_DXDataRow'+index).remove();
                    }
                    else { alert("删除失败！"); }
                });
            }

        }
        function search() {


            $("#hNSRMC").val(NSRMC.GetText());
            $("#hFEnterprisePropNo").val(FEnterprisePropNo.GetValue());
            $("#hFProp").val(FProp.GetValue());
            $("#hFTaxClassAllowanceNo").val(FTaxClassAllowanceNo.GetValue())
            gvEditing.Refresh();
        }
        function undo() {
            NSRMC.SetText("");
            FEnterprisePropNo.SetText("");
            FEnterprisePropNo.SetValue("");
            FProp.SetText("");
        }
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnAdd":
                    {
                        PolicyAdd();
                        break;
                    }
            }
        }
        
    </script>
</head>
<body>
    @Html.DevExpress().Menu(settings =>
{
    settings.Name = "toolBarMenu";
    settings.ItemAutoWidth = false;
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
    settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    settings.Items.Add(item =>
    {
        item.Name = "btnAdd";
        item.Text = "增加";
        item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
    });
    settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
    settings.ItemLinkMode = ItemLinkMode.ContentBounds;
}).GetHtml()
    <table class="query" width="840px" style="margin-left: auto; margin-right: auto">
        <tr>
            <td align="right" style="text-align: right">
               政策名称：
            </td>
            <td>
                @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRMC";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
               }).GetHtml()
            </td>
            <td align="right" style="text-align: right">
                企业性质：
            </td>
            <td>
                @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FEnterprisePropNo";
               settings.Properties.TextField = "FEnterprisePropName";
               settings.Properties.ValueField = "FEnterprisePropNo";
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
           }).BindList(ViewBag.EnterpriseProps).GetHtml()
            </td>
            <td align="right" style="text-align: right">
                类型：
            </td>
            <td>
                @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FProp";
               settings.Properties.Items.Add("普通政策", "1");
               settings.Properties.Items.Add("特殊政策", "2");
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
           }).GetHtml()
            </td>
           <td  align="right" style="text-align: right">补贴税种：</td>
        <td>   
            @Html.DevExpress().ComboBox(settings =>
           {
               settings.Name = "FTaxClassAllowanceNo";
               settings.Properties.TextField = "FTaxClassAllowanceName";
               settings.Properties.ValueField = "FTaxClassAllowanceNo";
               settings.Width = System.Web.UI.WebControls.Unit.Pixel(110);
           }).BindList(ViewBag.TaxClassAllowance).GetHtml()
        </td>
            <td colspan="2">
                <table>
                    <tr>
                        <td>
                            @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnSearch";
                               settings.Text = "查询";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                               settings.ClientSideEvents.Click = "search";
                           }).GetHtml()
                        </td>
                        <td>
                            @Html.DevExpress().Button(settings =>
                           {
                               settings.Name = "btnUndo";
                               settings.Text = "重置";
                               //settings.Height = System.Web.UI.WebControls.Unit.Pixel(20);
                               //settings.Width = System.Web.UI.WebControls.Unit.Pixel(100);
                               settings.ControlStyle.CssClass = "button";
                               settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                               settings.ClientSideEvents.Click = "undo";
                           }).GetHtml()
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    @Html.Partial("SuppoetPolicyPartial", Model)
    @Html.Hidden("hNSRMC", "")
    @Html.Hidden("hFEnterprisePropNo", "")
    @Html.Hidden("hFProp", "")\
    @Html.Hidden("hFTaxClassAllowanceNo","")
    <script>
        lp.Hide();
    </script>
</body>
</html>
